#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
const int N = 2e5 + 10;
int st[N], ed[N];
int n, m;
int main()
{
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		scanf("%d%d", &st[i], &ed[i]);
	}
	sort(st, st + n);
	sort(ed, ed + n);
	for (int i = 0; i < m; i++) {
		int x;
		scanf("%d", &x);
		int st1 = upper_bound(st, st + n, x) - st;
		int ed1 = lower_bound(ed, ed + n, x) - ed;
		printf("%d ", st1 - ed1);
	}
	return 0;
}